#define _CRT_SECURE_NO_WARNINGS 1

#include "game.h"

void menu()
{
	printf("*************************************\n");
	printf("*************   1.play   ************\n");
	printf("*************   0.exit   ************\n");
	printf("*************************************\n");
}

void game()
{
	char mine[ROWS][COLS] = { 0 };
	char show[ROWS][COLS] = { 0 };

	inital_board(mine, ROWS, COLS,'0');
	inital_board(show, ROWS, COLS, '*');

	//display_board(mine, ROW, COL);
	display_board(show, ROW, COL);

	set_mine(mine, ROW, COL);
	//display_board(mine, ROW, COL);

	get_mine(show, mine, ROW, COL);
}

void test()
{
	srand((unsigned int)time(NULL));
	int input = 0;
	do {
		menu();
		printf("Please enter your choice:>");
		scanf("%d", &input);
		switch (input)
		{
		case 1:
			game();
			break;
		case 0:
			printf("Game over\n");
			break;
		default:
			printf("Input error, please enter again!\n");
			break;
		}
	} while (input);
}

int main()
{
	test();
	return 0;
}